{
 "metadata": {
  "name": "",
  "signature": "sha256:1519dab7020cd3dcad3c0a2231839a7a21603c8887b1c8d4a55beb26708b5ee8"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import sys"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "sys.path.append('/Users/Pro/Ongoing/weibo')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 2
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import jieba"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 3
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from weiboPredict import framework as fw"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 5
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from pandas import Series,DataFrame"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 6
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.loadData()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 7
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import weiboPredict"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 8
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "reload(weiboPredict.framework)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "ename": "SyntaxError",
       "evalue": "Non-ASCII character '\\xef' in file /Users/Pro/Ongoing/weibo/weiboPredict/framework.py on line 76, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details (framework.py, line 76)",
       "output_type": "pyerr",
       "traceback": [
        "\u001b[0;36m  File \u001b[0;32m\"/Users/Pro/Ongoing/weibo/weiboPredict/framework.py\"\u001b[0;36m, line \u001b[0;32m76\u001b[0m\n\u001b[0;31m    at+= re.findall(\"@(.{0,30})\uff09\",context)\u001b[0m\n\u001b[0m                                          ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m Non-ASCII character '\\xef' in file /Users/Pro/Ongoing/weibo/weiboPredict/framework.py on line 76, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details\n"
       ]
      }
     ],
     "prompt_number": 245
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print fw.weibo_train_data.ix[0].context"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[\u5410]@\u4eac\u4e1c \u7684\u7528\u6237\u4f53\u9a8c\u592a\u5dee\u4e86....\u7b2c\u4e00\u6b21\u5728\u4eac\u4e1c\u8d2d\u7269\uff0c\u4e70\u4e86\u51e0\u767e\u7684\u4e66....\u771f\u662f\u7ecf\u5386\u4e86\u7f51\u8d2d\u7684\u5404\u79cd\u95ee\u9898...1.\u8d27\u5230\u4e86\uff0c\u6ca1\u7ed9\u53d1\u7968\u30022.\u8d27\u5230\u4e86\uff0c2\u672c\u4e66\uff0c\u7f51\u4e0a\u663e\u793a\u90fd\u53d1\u8d27\u4e86\uff0c\u5305\u88f9\u91cc\u53ea\u67091\u672c\uff0c\u800c\u4e14\u6ca1\u53d1\u7968...\u95ee\u5e97\u5bb6\uff0c\u5e97\u5bb6\u627f\u8ba4\u53e6\u5916\u4e00\u672c\u6ca1\u8d27...\u5e97\u5bb6\u8ba9\u6211\u786e\u8ba4\u6536\u8d27\u624d\u9000\u94b1...[\u601d\u8003]\u30023.\u6ca1\u6709\u8d27\u7269\u6e05\u5355...\u6216\u8005\u6e05\u5355\u662f\u4e00\u4e2a\u5e9f\u5f03A4\u6253\u7684\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print fw.weibo_train_data.ix[1].context"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "#\u6211\u7231\u5c0f\u7c73\u624b\u673a#\u56e0\u4e3a\u5c0f\u7c73\u624b\u673a4\u7684\u5c4f\u5e55\u592a\u7ed9\u529b\u4e86\uff0c5\u82f1\u5bf8\u7684\u9ad8\u8272\u5f69\u9971\u548c\u5ea6\u590f\u666e / JDI\u5c4f\u5e55\uff0c1920x1080\u5168\u9ad8\u6e05\u5206\u8fa8\u7387\uff0c\u73a9\u6e38\u620f\uff0c\u770b\u9ad8\u6e05\u89c6\u9891\u723d\u7206\u4e86\u300211\u670818\u65e5\u4e2d\u534812\u70b9\u5f00\u653e\u8d2d\u4e70\uff0c\u4ec5\u552e1999\u5143\uff0c\u5e0c\u671b\u80fd\u4e70\u52301\u53f0\u3002@\u5c0f\u7c73\u624b\u673a @\u5356\u4ed9\u5251\u7684\u9152\u5251\u4ed9  @\u6d77\u5148\u751fV  \uff0c\u5206\u4eab\u514d\u8d39\u9884\u7ea6\u5730\u5740http://t.cn/RPkmgBL\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print '/'.join('\u674e\u6668Jeremy Li is a good man\u54c8\u54c8\u54c8')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\ufffd/\ufffd/\ufffd/\ufffd/\ufffd/\ufffd/J/e/r/e/m/y/ /L/i/ /i/s/ /a/ /g/o/o/d/ /m/a/n/\ufffd/\ufffd/\ufffd/\ufffd/\ufffd/\ufffd/\ufffd/\ufffd/\ufffd\n"
       ]
      }
     ],
     "prompt_number": 60
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print fw.weibo_train_data.ix[3].context"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[doge]\u627e\u5de5\u4f5c\u256e(\u256f\u25bd\u2570)\u256d\u2026\u2026\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print '/'.join(jieba.lcut(fw.weibo_train_data.ix[3].context))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[/doge/]/\u627e/\u5de5\u4f5c/\u256e/(/\u256f/\u25bd/\u2570/)/\u256d/\u2026/\u2026\n"
       ]
      }
     ],
     "prompt_number": 38
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print fw.weibo_train_data.ix[5].context"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "#\u9b54\u6d6a\u6f6e\u7206U5\u667a\u80fd\u8033\u673a#\u201c\u5173\u6ce8@\u9b54\u6d6a\u84dd\u7259\u8033\u673a+\u8f6c\u53d1\u672c\u5fae\u535a\u5e76@3\u4f4d\u597d\u53cb+#\u9b54\u6d6a\u6f6e\u7206U5\u667a\u80fd\u8033\u673a#+\u514d\u8d39\u4f53\u9a8c\u7684\u52a8\u4eba\u7406\u7531\u201d\u5373\u6709\u673a\u4f1a\u83b7\u5f97\u514d\u8d39\u4f53\u9a8c\u8d44\u683c\uff0c\u6211\u5df2\u7ecf\u53c2\u52a0\u4e86\uff0c\u4f60\u4eec\u5feb\u6765\u5440\uff01\uff01 http://t.cn/R7BhYdI\n"
       ]
      }
     ],
     "prompt_number": 40
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print '/'.join(jieba.lcut(fw.weibo_train_data.ix[5].context))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "#/\u9b54/\u6d6a\u6f6e/\u7206/U5/\u667a\u80fd/\u8033\u673a/#/\u201c/\u5173\u6ce8/@/\u9b54\u6d6a/\u84dd\u7259/\u8033\u673a/+/\u8f6c\u53d1/\u672c\u5fae\u535a/\u5e76/@/3/\u4f4d/\u597d\u53cb/+#/\u9b54/\u6d6a\u6f6e/\u7206/U5/\u667a\u80fd/\u8033\u673a/#+/\u514d\u8d39/\u4f53\u9a8c/\u7684/\u52a8\u4eba/\u7406\u7531/\u201d/\u5373/\u6709/\u673a\u4f1a/\u83b7\u5f97/\u514d\u8d39/\u4f53\u9a8c/\u8d44\u683c/\uff0c/\u6211/\u5df2\u7ecf/\u53c2\u52a0/\u4e86/\uff0c/\u4f60\u4eec/\u5feb\u6765/\u5440/\uff01/\uff01/ /http/://///t/./cn///R7BhYdI\n"
       ]
      }
     ],
     "prompt_number": 42
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "1. \u8868\u60c5\u7b26\u53f7\uff08\u5305\u62ecemojo\u548c\u6807\u70b9\u7b26\u53f7\u7ec4\u6210\u7684\u8868\u60c5\uff09-> \u6682\u65f6\u4f5c\u4e3a\u6b63\u5e38\u503c\u5206\u8bcd\n",
      "2. @\u67d0\u4f4d\u7528\u6237 -> \u76ee\u524d\u6307\u53bb\u9664@\uff0c\u7528\u6237\u540d\u6b63\u5e38\u5206\u8bcd\n",
      "3. \u6807\u7b7e## -> \u76ee\u524d\u5148\u53ea\u53bb\u9664#\uff0c\u6807\u7b7e\u6b63\u5e38\u5206\u8bcd\n",
      "4. \u94fe\u63a5 -> \u6b63\u5219\u8868\u8fbe\u5f0f\u53bb\u9664\n",
      "5. \u505c\u7528\u8bcd -> \u505c\u7528\u8bcd\u8868\u53bb\u9664\n",
      "6. \u6570\u5b57 -> \u6b63\u5219\u8868\u8fbe\u5f0f\u53bb\u9664\n",
      "7. \u6807\u70b9\u7b26\u53f7 -> \u6682\u65f6\u5305\u62ec\u5728\u505c\u7528\u8bcd\u4e2d\u53bb\u9664\n",
      "8. \u7a7a\u683c -> \u53bb\u9664\n",
      "9. \u82f1\u6587 -> \u6682\u65f6\u4e0d\u53bb\u9664\n",
      "10. \u65f6\u95f4\u65e5\u671f -> \u6682\u65f6\u4e0d\u5904\u7406"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print '/'.join(jieba.lcut(\"my nameeeeeeeee is lichen\"))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "my/ /nameeeeeeeee/ /is/ /lichen\n"
       ]
      }
     ],
     "prompt_number": 45
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "for c in fw.weibo_train_data.context[:5]:\n",
      "    print c"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[\u5410]@\u4eac\u4e1c \u7684\u7528\u6237\u4f53\u9a8c\u592a\u5dee\u4e86....\u7b2c\u4e00\u6b21\u5728\u4eac\u4e1c\u8d2d\u7269\uff0c\u4e70\u4e86\u51e0\u767e\u7684\u4e66....\u771f\u662f\u7ecf\u5386\u4e86\u7f51\u8d2d\u7684\u5404\u79cd\u95ee\u9898...1.\u8d27\u5230\u4e86\uff0c\u6ca1\u7ed9\u53d1\u7968\u30022.\u8d27\u5230\u4e86\uff0c2\u672c\u4e66\uff0c\u7f51\u4e0a\u663e\u793a\u90fd\u53d1\u8d27\u4e86\uff0c\u5305\u88f9\u91cc\u53ea\u67091\u672c\uff0c\u800c\u4e14\u6ca1\u53d1\u7968...\u95ee\u5e97\u5bb6\uff0c\u5e97\u5bb6\u627f\u8ba4\u53e6\u5916\u4e00\u672c\u6ca1\u8d27...\u5e97\u5bb6\u8ba9\u6211\u786e\u8ba4\u6536\u8d27\u624d\u9000\u94b1...[\u601d\u8003]\u30023.\u6ca1\u6709\u8d27\u7269\u6e05\u5355...\u6216\u8005\u6e05\u5355\u662f\u4e00\u4e2a\u5e9f\u5f03A4\u6253\u7684\n",
        "#\u6211\u7231\u5c0f\u7c73\u624b\u673a#\u56e0\u4e3a\u5c0f\u7c73\u624b\u673a4\u7684\u5c4f\u5e55\u592a\u7ed9\u529b\u4e86\uff0c5\u82f1\u5bf8\u7684\u9ad8\u8272\u5f69\u9971\u548c\u5ea6\u590f\u666e / JDI\u5c4f\u5e55\uff0c1920x1080\u5168\u9ad8\u6e05\u5206\u8fa8\u7387\uff0c\u73a9\u6e38\u620f\uff0c\u770b\u9ad8\u6e05\u89c6\u9891\u723d\u7206\u4e86\u300211\u670818\u65e5\u4e2d\u534812\u70b9\u5f00\u653e\u8d2d\u4e70\uff0c\u4ec5\u552e1999\u5143\uff0c\u5e0c\u671b\u80fd\u4e70\u52301\u53f0\u3002@\u5c0f\u7c73\u624b\u673a @\u5356\u4ed9\u5251\u7684\u9152\u5251\u4ed9  @\u6d77\u5148\u751fV  \uff0c\u5206\u4eab\u514d\u8d39\u9884\u7ea6\u5730\u5740http://t.cn/RPkmgBL\n",
        "[doge][\u55b5\u55b5]\u5929\u732b\u771f\u662f\u725b....\u5356\u5b9e\u9a8c\u8017\u6750\u7684\u90fd\u8dd1\u5929\u732b\u53bb\u5f00\u5e97\u4e86...\n",
        "[doge]\u627e\u5de5\u4f5c\u256e(\u256f\u25bd\u2570)\u256d\u2026\u2026\n",
        "[doge]\u6210\u529f\u62a2\u4e86\u53f0\u7c734\u7535\u4fe1~\n"
       ]
      }
     ],
     "prompt_number": 48
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "f=open('../data/stopwords.txt','r')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 89
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "stopwords = [l.strip() for l in f.readlines()]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 90
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print stopwords[100]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\u800c\u5916\n"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "text = jieba.lcut(fw.weibo_train_data.context[0])"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 152
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "clean = [t for t in text if t not in stopwords]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 170
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "stopwords[2].encode('utf8')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "ename": "UnicodeDecodeError",
       "evalue": "'ascii' codec can't decode byte 0xe3 in position 0: ordinal not in range(128)",
       "output_type": "pyerr",
       "traceback": [
        "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mUnicodeDecodeError\u001b[0m                        Traceback (most recent call last)",
        "\u001b[0;32m<ipython-input-20-995d90a93e63>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mstopwords\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mencode\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'utf8'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
        "\u001b[0;31mUnicodeDecodeError\u001b[0m: 'ascii' codec can't decode byte 0xe3 in position 0: ordinal not in range(128)"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "for i in range(len(stopwords)):\n",
      "    stopwords[i] = stopwords[i].decode('utf8')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 91
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print stopwords[100]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\u800c\u5916\n"
       ]
      }
     ],
     "prompt_number": 78
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print '/'.join(clean)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\u5410/\u4eac\u4e1c/ /\u7528\u6237/\u4f53\u9a8c/\u592a\u5dee/..../\u7b2c\u4e00\u6b21/\u4eac\u4e1c/\u8d2d\u7269/\u4e70/\u51e0\u767e/\u4e66/..../\u771f\u662f/\u7ecf\u5386/\u7f51\u8d2d/\u95ee\u9898/\u8d27\u5230/\u53d1\u7968/\u8d27\u5230/\u672c\u4e66/\u7f51\u4e0a/\u663e\u793a/\u53d1\u8d27/\u5305\u88f9/\u91cc/\u53d1\u7968/\u95ee/\u5e97\u5bb6/\u5e97\u5bb6/\u627f\u8ba4/\u4e00\u672c/\u6ca1\u8d27/\u5e97\u5bb6/\u786e\u8ba4/\u6536\u8d27/\u9000\u94b1/\u601d\u8003/\u8d27\u7269/\u6e05\u5355/\u6e05\u5355/\u4e00\u4e2a/\u5e9f\u5f03/A4\n"
       ]
      }
     ],
     "prompt_number": 171
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print '/'.join(jieba.lcut(fw.weibo_train_data.ix[0].context))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[/\u5410/]/@/\u4eac\u4e1c/ /\u7684/\u7528\u6237/\u4f53\u9a8c/\u592a\u5dee/\u4e86/..../\u7b2c\u4e00\u6b21/\u5728/\u4eac\u4e1c/\u8d2d\u7269/\uff0c/\u4e70/\u4e86/\u51e0\u767e/\u7684/\u4e66/..../\u771f\u662f/\u7ecf\u5386/\u4e86/\u7f51\u8d2d/\u7684/\u5404\u79cd/\u95ee\u9898/.../1/./\u8d27\u5230/\u4e86/\uff0c/\u6ca1/\u7ed9/\u53d1\u7968/\u3002/2/./\u8d27\u5230/\u4e86/\uff0c/2/\u672c\u4e66/\uff0c/\u7f51\u4e0a/\u663e\u793a/\u90fd/\u53d1\u8d27/\u4e86/\uff0c/\u5305\u88f9/\u91cc/\u53ea\u6709/1/\u672c/\uff0c/\u800c\u4e14/\u6ca1/\u53d1\u7968/.../\u95ee/\u5e97\u5bb6/\uff0c/\u5e97\u5bb6/\u627f\u8ba4/\u53e6\u5916/\u4e00\u672c/\u6ca1\u8d27/.../\u5e97\u5bb6/\u8ba9/\u6211/\u786e\u8ba4/\u6536\u8d27/\u624d/\u9000\u94b1/.../[/\u601d\u8003/]/\u3002/3/./\u6ca1\u6709/\u8d27\u7269/\u6e05\u5355/.../\u6216\u8005/\u6e05\u5355/\u662f/\u4e00\u4e2a/\u5e9f\u5f03/A4/\u6253/\u7684\n"
       ]
      }
     ],
     "prompt_number": 138
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "'\uff09'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 246,
       "text": [
        "'\\xef\\xbc\\x89'"
       ]
      }
     ],
     "prompt_number": 246
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "'1ST\u91cc'.lower()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 44,
       "text": [
        "'1st\\xe9\\x87\\x8c'"
       ]
      }
     ],
     "prompt_number": 44
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print stopwords[212]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\u4e86\n"
       ]
      }
     ],
     "prompt_number": 29
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print re.findall(\"http://.*\\w$\",fw.weibo_train_data.context[9])"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[]\n"
       ]
      }
     ],
     "prompt_number": 62
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "for c in fw.weibo_train_data.context[:20]:\n",
      "    print c"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[\u5410]@\u4eac\u4e1c \u7684\u7528\u6237\u4f53\u9a8c\u592a\u5dee\u4e86....\u7b2c\u4e00\u6b21\u5728\u4eac\u4e1c\u8d2d\u7269\uff0c\u4e70\u4e86\u51e0\u767e\u7684\u4e66....\u771f\u662f\u7ecf\u5386\u4e86\u7f51\u8d2d\u7684\u5404\u79cd\u95ee\u9898...1.\u8d27\u5230\u4e86\uff0c\u6ca1\u7ed9\u53d1\u7968\u30022.\u8d27\u5230\u4e86\uff0c2\u672c\u4e66\uff0c\u7f51\u4e0a\u663e\u793a\u90fd\u53d1\u8d27\u4e86\uff0c\u5305\u88f9\u91cc\u53ea\u67091\u672c\uff0c\u800c\u4e14\u6ca1\u53d1\u7968...\u95ee\u5e97\u5bb6\uff0c\u5e97\u5bb6\u627f\u8ba4\u53e6\u5916\u4e00\u672c\u6ca1\u8d27...\u5e97\u5bb6\u8ba9\u6211\u786e\u8ba4\u6536\u8d27\u624d\u9000\u94b1...[\u601d\u8003]\u30023.\u6ca1\u6709\u8d27\u7269\u6e05\u5355...\u6216\u8005\u6e05\u5355\u662f\u4e00\u4e2a\u5e9f\u5f03A4\u6253\u7684\n",
        "#\u6211\u7231\u5c0f\u7c73\u624b\u673a#\u56e0\u4e3a\u5c0f\u7c73\u624b\u673a4\u7684\u5c4f\u5e55\u592a\u7ed9\u529b\u4e86\uff0c5\u82f1\u5bf8\u7684\u9ad8\u8272\u5f69\u9971\u548c\u5ea6\u590f\u666e / JDI\u5c4f\u5e55\uff0c1920x1080\u5168\u9ad8\u6e05\u5206\u8fa8\u7387\uff0c\u73a9\u6e38\u620f\uff0c\u770b\u9ad8\u6e05\u89c6\u9891\u723d\u7206\u4e86\u300211\u670818\u65e5\u4e2d\u534812\u70b9\u5f00\u653e\u8d2d\u4e70\uff0c\u4ec5\u552e1999\u5143\uff0c\u5e0c\u671b\u80fd\u4e70\u52301\u53f0\u3002@\u5c0f\u7c73\u624b\u673a @\u5356\u4ed9\u5251\u7684\u9152\u5251\u4ed9  @\u6d77\u5148\u751fV  \uff0c\u5206\u4eab\u514d\u8d39\u9884\u7ea6\u5730\u5740http://t.cn/RPkmgBL\n",
        "[doge][\u55b5\u55b5]\u5929\u732b\u771f\u662f\u725b....\u5356\u5b9e\u9a8c\u8017\u6750\u7684\u90fd\u8dd1\u5929\u732b\u53bb\u5f00\u5e97\u4e86...\n",
        "[doge]\u627e\u5de5\u4f5c\u256e(\u256f\u25bd\u2570)\u256d\u2026\u2026\n",
        "[doge]\u6210\u529f\u62a2\u4e86\u53f0\u7c734\u7535\u4fe1~\n",
        "#\u9b54\u6d6a\u6f6e\u7206U5\u667a\u80fd\u8033\u673a#\u201c\u5173\u6ce8@\u9b54\u6d6a\u84dd\u7259\u8033\u673a+\u8f6c\u53d1\u672c\u5fae\u535a\u5e76@3\u4f4d\u597d\u53cb+#\u9b54\u6d6a\u6f6e\u7206U5\u667a\u80fd\u8033\u673a#+\u514d\u8d39\u4f53\u9a8c\u7684\u52a8\u4eba\u7406\u7531\u201d\u5373\u6709\u673a\u4f1a\u83b7\u5f97\u514d\u8d39\u4f53\u9a8c\u8d44\u683c\uff0c\u6211\u5df2\u7ecf\u53c2\u52a0\u4e86\uff0c\u4f60\u4eec\u5feb\u6765\u5440\uff01\uff01 http://t.cn/R7BhYdI\n",
        "[\u53ef\u601c] \u53f2\u4e0a\u6700\u96be\u767b\u7684\u7684\u7f51\u7ad9\uff1ahttp://t.cn/R78fdMf\n",
        "[\u6253\u8138]\u524d\u5929\u786e\u8ba4\u62a5\u540d\u3002\u3002\u3002\u3002\u4eca\u5929\u5356\u72ec\u5bb6\u5185\u90e8\u8d44\u6599\u7684\u7535\u8bdd\u5c31\u6765\u4e86\u3002\u3002\u3002\u3002\n",
        "\u53cc\u5341\u4e00\u540e\u9057\u75c7....42\u7801\u677f\u978b...\u5168\u7f3a\u8d27...\n",
        "\u3010\u8bba\u575b\u6e90\u7801\u63a8\u8350\uff086\u670830\u65e5\uff09\uff1aiOS\u5f00\u6e90RSS\u65b0\u95fb\u9605\u8bfb\u5668 \u53ef\u81ea\u52a8\u586b\u5145\u7684\u6587\u672c\u6846\u3011 http://t.cn/RvuICAU  \uff08\u5206\u4eab\u81ea@\u65e0\u89c5\u9605\u8bfb\uff09\n",
        "\u3010Hadoop\u79d1\u666e\u6587\u2014\u2014\u5e38\u89c1\u768445\u4e2a\u95ee\u9898\u89e3\u7b54\u3011 http://t.cn/Rvrui7S  \uff08\u5206\u4eab\u81ea@\u65e0\u89c5\u9605\u8bfb\uff09\n",
        "\u3010MySQL\u7d22\u5f15\u539f\u7406\u53ca\u6162\u67e5\u8be2\u4f18\u5316\u3011 http://t.cn/RvsXH5D  \uff08\u5206\u4eab\u81ea@\u65e0\u89c5\u9605\u8bfb\uff09\n",
        "\u3010\u7f51\u7ad9\u7528\u6237\u8bbf\u95ee\u901f\u5ea6\u76d1\u6d4b\u5206\u6790\u9879\u76ee(1)\u3011 http://t.cn/RPLC0uY  \uff08\u5206\u4eab\u81ea@\u65e0\u89c5\u9605\u8bfb\uff09\n",
        "\u3010\u4e0d\u540cvlan\u95f4\u901a\u4fe1\u5982\u4f55\u5b9e\u73b0\uff1f\u3011 http://t.cn/RPLOZ49  \uff08\u5206\u4eab\u81ea@\u65e0\u89c5\u9605\u8bfb\uff09\n",
        "\u5c0f\u4f19\u4f34\u4eec\uff0c\u5feb\u6765\u56f4\u89c2\uff01\u6211\u5df2\u7ecf\u5347\u7ea7\u4e3aV6\u65b0\u7248\u5fae\u535a\uff0c\u7b80\u6d01\u7684\u754c\u9762\u5e26\u6765\u66f4\u6d41\u7545\u7684\u4f53\u9a8c\u3002\u51c6\u5907\u597d\u4e86\u5417\uff1f\u548c\u6211\u4eec\u4e00\u8d77\u53d1\u73b0\u65b0\u7684\u4e16\u754c\u5427\uff01\u5347\u7ea7\u731b\u6233:http://t.cn/R7vgnNI http://t.cn/R7PW0Ng\n",
        "\u6211\u521a\u6362\u4e86\u201c\u60c5\u8ff7\u5b9d\u4e3d\u6765\u201d\u5957\u88c5\uff0c\u597d\u6f02\u4eae\uff0c\u4f60\u4eec\u90fd\u5feb\u6765\u8bd5\u8bd5\uff01 http://weibo.com/home?skinId=skin053\n",
        "5k \u7684iMac\u597d\u50cf\u5f88\u4e0d\u9519\n",
        "\u4eca\u5929\u9047\u5230\u4e86\u4e24\u4e2a\u5947\u8469\n",
        "\u6ca1\u4e8b\uff0c\u53ea\u662f\u6280\u672f\u8c03\u6574\n",
        "\u81ea\u5df1\u628a\u8138\u90fd\u6293\u4f24\u4e86\uff0c\u6240\u4ee5\u5e26\u4e0a\u4e86\u624b\u5957\u2026 http://t.cn/Rv3EAY4\n"
       ]
      }
     ],
     "prompt_number": 103
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import re\n",
      "from nltk.corpus import stopwords as e_stopwords\n",
      "for i,context in enumerate(fw.weibo_train_data.context[0:80]):\n",
      "    print str(i)+'.'\n",
      "    print context\n",
      "    #\u53bb\u9664\u94fe\u63a5\n",
      "    context = re.sub(\"http://[a-zA-z./\\d]*\",\"\",context)\n",
      "    #\u53bb\u9664\u8868\u60c5\u7b26\u53f7\n",
      "    context = re.sub(\"\\[.{0,12}\\]\",\"\",context)\n",
      "    #\u63d0\u53d6tag\n",
      "    tags = re.findall(\"#(.{0,30})#\",context)\n",
      "    context = re.sub(\"#.{0,30}#\",\"\",context)\n",
      "    #\u63d0\u53d6@\u67d0\u4eba\n",
      "    at = re.findall(\"@([^@]{0,30})\\s\",context)\n",
      "    context = re.sub(\"@([^@]{0,30})\\s\",\"\",context)\n",
      "    at+= re.findall(\"@([^@]{0,30})\uff09\",context)\n",
      "    context = re.sub(\"@([^@]{0,30})\uff09\",\"\",context)\n",
      "    #\u82f1\u6587\u5b57\u6bcd\u53d8\u5c0f\u5199\n",
      "    context  = context.lower()\n",
      "    #\u627e\u51fa\u6240\u6709\u82f1\u6587\u5b57\u7b26\u548c\u5355\u8bcd\u5e76\u63d0\u53d6\n",
      "    english = re.findall(\"[a-z]+\",context)\n",
      "    context = re.sub(\"[a-z]+\",\"\",context)\n",
      "    #\u53bb\u9664\u6807\u70b9\u7b26\u53f7\n",
      "    context = re.sub(\"[\\s+\\.\\!\\/_,$%^*(+\\\"\\']+|[+\u2014\u2014\uff01\uff0c\u3002\uff1f\u3001~@#\uffe5%\u2026\u2026&*\uff08\uff09]+\".decode(\"utf8\"), \"\",context)\n",
      "    context = re.sub(\"[\u3010\u3011\u256e\u256f\u25bd\u2570\u256d\u2605\u2192\u300c\u300d]+\".decode(\"utf8\"),\"\",context.decode('utf8'))\n",
      "    #\u53bb\u9664\u7a7a\u683c\n",
      "    context = re.sub(\"\\s\",\"\",context)\n",
      "    #\u53bb\u9664\u6240\u6709\u6570\u5b57\n",
      "    context = re.sub(\"\\d\",\"\",context)\n",
      "    #\u53bb\u9664\u81ea\u5df1\u6253\u7684\u7701\u7565\u53f7\n",
      "    context = re.sub(\"\\.*\",\"\",context)\n",
      "    #\u5206\u8bcd\n",
      "    text = jieba.lcut(context)\n",
      "    #\u53bb\u9664\u4e2d\u6587\u505c\u7528\u8bcd\n",
      "    clean = [t for t in text if t not in stopwords]\n",
      "    #\u53bb\u9664\u82f1\u6587\u505c\u7528\u8bcd\u4e0e\u5355\u4e2a\u82f1\u6587\u5b57\u6bcd\n",
      "    e_clean = [t for t in english if t not in e_stopwords.words('english') and len(t) is not 1]\n",
      "    clean+=e_clean\n",
      "    clean+=Series(tags).apply(lambda x:x.decode('utf8')).tolist()\n",
      "    clean+=Series(at).apply(lambda x:x.decode('utf8')).tolist()\n",
      "    \n",
      "    print '|'.join(clean)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "0.\n",
        "[\u5410]@\u4eac\u4e1c \u7684\u7528\u6237\u4f53\u9a8c\u592a\u5dee\u4e86....\u7b2c\u4e00\u6b21\u5728\u4eac\u4e1c\u8d2d\u7269\uff0c\u4e70\u4e86\u51e0\u767e\u7684\u4e66....\u771f\u662f\u7ecf\u5386\u4e86\u7f51\u8d2d\u7684\u5404\u79cd\u95ee\u9898...1.\u8d27\u5230\u4e86\uff0c\u6ca1\u7ed9\u53d1\u7968\u30022.\u8d27\u5230\u4e86\uff0c2\u672c\u4e66\uff0c\u7f51\u4e0a\u663e\u793a\u90fd\u53d1\u8d27\u4e86\uff0c\u5305\u88f9\u91cc\u53ea\u67091\u672c\uff0c\u800c\u4e14\u6ca1\u53d1\u7968...\u95ee\u5e97\u5bb6\uff0c\u5e97\u5bb6\u627f\u8ba4\u53e6\u5916\u4e00\u672c\u6ca1\u8d27...\u5e97\u5bb6\u8ba9\u6211\u786e\u8ba4\u6536\u8d27\u624d\u9000\u94b1...[\u601d\u8003]\u30023.\u6ca1\u6709\u8d27\u7269\u6e05\u5355...\u6216\u8005\u6e05\u5355\u662f\u4e00\u4e2a\u5e9f\u5f03A4\u6253\u7684\n",
        "\u7528\u6237|\u4f53\u9a8c|\u592a\u5dee|\u7b2c\u4e00\u6b21|\u4eac\u4e1c|\u8d2d\u7269|\u4e70|\u51e0\u767e|\u4e66|\u771f\u662f|\u7ecf\u5386|\u7f51\u8d2d|\u95ee\u9898|\u8d27\u5230|\u53d1\u7968|\u8d27\u5230|\u672c\u4e66|\u7f51\u4e0a|\u663e\u793a|\u53d1\u8d27|\u5305\u88f9|\u91cc|\u53d1\u7968|\u95ee|\u5e97\u5bb6|\u5e97\u5bb6|\u627f\u8ba4|\u4e00\u672c|\u6ca1\u8d27|\u5e97\u5bb6|\u786e\u8ba4|\u6536\u8d27|\u9000\u94b1|\u8d27\u7269|\u6e05\u5355|\u6e05\u5355|\u4e00\u4e2a|\u5e9f\u5f03|\u4eac\u4e1c\n",
        "1.\n",
        "#\u6211\u7231\u5c0f\u7c73\u624b\u673a#\u56e0\u4e3a\u5c0f\u7c73\u624b\u673a4\u7684\u5c4f\u5e55\u592a\u7ed9\u529b\u4e86\uff0c5\u82f1\u5bf8\u7684\u9ad8\u8272\u5f69\u9971\u548c\u5ea6\u590f\u666e / JDI\u5c4f\u5e55\uff0c1920x1080\u5168\u9ad8\u6e05\u5206\u8fa8\u7387\uff0c\u73a9\u6e38\u620f\uff0c\u770b\u9ad8\u6e05\u89c6\u9891\u723d\u7206\u4e86\u300211\u670818\u65e5\u4e2d\u534812\u70b9\u5f00\u653e\u8d2d\u4e70\uff0c\u4ec5\u552e1999\u5143\uff0c\u5e0c\u671b\u80fd\u4e70\u52301\u53f0\u3002@\u5c0f\u7c73\u624b\u673a @\u5356\u4ed9\u5251\u7684\u9152\u5251\u4ed9  @\u6d77\u5148\u751fV  \uff0c\u5206\u4eab\u514d\u8d39\u9884\u7ea6\u5730\u5740http://t.cn/RPkmgBL\n",
        "\u5c0f\u7c73|\u624b\u673a|\u5c4f\u5e55|\u592a\u7ed9\u529b|\u82f1\u5bf8|\u9ad8|\u8272\u5f69|\u9971\u548c\u5ea6|\u590f\u666e|\u5c4f\u5e55|\u5168\u9ad8\u6e05|\u5206\u8fa8\u7387|\u73a9\u6e38\u620f|\u9ad8\u6e05|\u89c6\u9891|\u723d\u7206|\u4e2d\u5348|\u70b9|\u5f00\u653e|\u8d2d\u4e70|\u4ec5\u552e\u5143|\u5e0c\u671b|\u4e70|\u53f0|\u5206\u4eab|\u514d\u8d39|\u9884\u7ea6|\u5730\u5740|jdi|\u6211\u7231\u5c0f\u7c73\u624b\u673a|\u5c0f\u7c73\u624b\u673a|\u5356\u4ed9\u5251\u7684\u9152\u5251\u4ed9 |\u6d77\u5148\u751fV \n",
        "2.\n",
        "[doge][\u55b5\u55b5]\u5929\u732b\u771f\u662f\u725b....\u5356\u5b9e\u9a8c\u8017\u6750\u7684\u90fd\u8dd1\u5929\u732b\u53bb\u5f00\u5e97\u4e86...\n",
        "\u5929\u732b|\u771f\u662f|\u725b\u5356|\u5b9e\u9a8c|\u8017\u6750|\u8dd1|\u5929\u732b|\u5f00\u5e97\n",
        "3.\n",
        "[doge]\u627e\u5de5\u4f5c\u256e(\u256f\u25bd\u2570)\u256d\u2026\u2026\n",
        "\u627e|\u5de5\u4f5c\n",
        "4.\n",
        "[doge]\u6210\u529f\u62a2\u4e86\u53f0\u7c734\u7535\u4fe1~\n",
        "\u6210\u529f|\u62a2|\u53f0\u7c73|\u7535\u4fe1\n",
        "5.\n",
        "#\u9b54\u6d6a\u6f6e\u7206U5\u667a\u80fd\u8033\u673a#\u201c\u5173\u6ce8@\u9b54\u6d6a\u84dd\u7259\u8033\u673a+\u8f6c\u53d1\u672c\u5fae\u535a\u5e76@3\u4f4d\u597d\u53cb+#\u9b54\u6d6a\u6f6e\u7206U5\u667a\u80fd\u8033\u673a#+\u514d\u8d39\u4f53\u9a8c\u7684\u52a8\u4eba\u7406\u7531\u201d\u5373\u6709\u673a\u4f1a\u83b7\u5f97\u514d\u8d39\u4f53\u9a8c\u8d44\u683c\uff0c\u6211\u5df2\u7ecf\u53c2\u52a0\u4e86\uff0c\u4f60\u4eec\u5feb\u6765\u5440\uff01\uff01 http://t.cn/R7BhYdI\n",
        "\u5173\u6ce8|\u9b54\u6d6a|\u84dd\u7259|\u8033\u673a|\u8f6c\u53d1|\u672c\u5fae\u535a|\u5e76\u4f4d|\u597d\u53cb|\u514d\u8d39|\u4f53\u9a8c|\u52a8\u4eba|\u7406\u7531|\u673a\u4f1a|\u83b7\u5f97|\u514d\u8d39|\u4f53\u9a8c|\u8d44\u683c|\u5df2\u7ecf|\u53c2\u52a0|\u5feb\u6765|\u9b54\u6d6a\u6f6e\u7206U5\u667a\u80fd\u8033\u673a|\u9b54\u6d6a\u6f6e\u7206U5\u667a\u80fd\u8033\u673a\n",
        "6.\n",
        "[\u53ef\u601c] \u53f2\u4e0a\u6700\u96be\u767b\u7684\u7684\u7f51\u7ad9\uff1ahttp://t.cn/R78fdMf\n",
        "\u53f2\u4e0a|\u6700\u96be|\u767b|\u7f51\u7ad9\n",
        "7.\n",
        "[\u6253\u8138]\u524d\u5929\u786e\u8ba4\u62a5\u540d\u3002\u3002\u3002\u3002\u4eca\u5929\u5356\u72ec\u5bb6\u5185\u90e8\u8d44\u6599\u7684\u7535\u8bdd\u5c31\u6765\u4e86\u3002\u3002\u3002\u3002\n",
        "\u524d\u5929|\u786e\u8ba4|\u62a5\u540d|\u4eca\u5929|\u5356|\u72ec\u5bb6|\u5185\u90e8\u8d44\u6599|\u7535\u8bdd\n",
        "8.\n",
        "\u53cc\u5341\u4e00\u540e\u9057\u75c7....42\u7801\u677f\u978b...\u5168\u7f3a\u8d27...\n",
        "\u53cc\u5341|\u540e\u9057\u75c7|\u7801\u677f|\u978b\u5168|\u7f3a\u8d27\n",
        "9.\n",
        "\u3010\u8bba\u575b\u6e90\u7801\u63a8\u8350\uff086\u670830\u65e5\uff09\uff1aiOS\u5f00\u6e90RSS\u65b0\u95fb\u9605\u8bfb\u5668 \u53ef\u81ea\u52a8\u586b\u5145\u7684\u6587\u672c\u6846\u3011 http://t.cn/RvuICAU  \uff08\u5206\u4eab\u81ea@\u65e0\u89c5\u9605\u8bfb\uff09\n",
        "\u8bba\u575b|\u6e90\u7801|\u63a8\u8350|\u5f00\u6e90|\u65b0\u95fb|\u9605\u8bfb\u5668|\u81ea\u52a8|\u586b\u5145|\u6587\u672c\u6846|\u5206\u4eab|ios|rss|\u65e0\u89c5\u9605\u8bfb\n",
        "10.\n",
        "\u3010Hadoop\u79d1\u666e\u6587\u2014\u2014\u5e38\u89c1\u768445\u4e2a\u95ee\u9898\u89e3\u7b54\u3011 http://t.cn/Rvrui7S  \uff08\u5206\u4eab\u81ea@\u65e0\u89c5\u9605\u8bfb\uff09\n",
        "\u79d1\u666e|\u6587|\u5e38\u89c1|\u95ee\u9898\u89e3\u7b54|\u5206\u4eab|hadoop|\u65e0\u89c5\u9605\u8bfb\n",
        "11.\n",
        "\u3010MySQL\u7d22\u5f15\u539f\u7406\u53ca\u6162\u67e5\u8be2\u4f18\u5316\u3011 http://t.cn/RvsXH5D  \uff08\u5206\u4eab\u81ea@\u65e0\u89c5\u9605\u8bfb\uff09\n",
        "\u7d22\u5f15|\u539f\u7406|\u53ca\u6162|\u67e5\u8be2|\u4f18\u5316|\u5206\u4eab|mysql|\u65e0\u89c5\u9605\u8bfb\n",
        "12.\n",
        "\u3010\u7f51\u7ad9\u7528\u6237\u8bbf\u95ee\u901f\u5ea6\u76d1\u6d4b\u5206\u6790\u9879\u76ee(1)\u3011 http://t.cn/RPLC0uY  \uff08\u5206\u4eab\u81ea@\u65e0\u89c5\u9605\u8bfb\uff09\n",
        "\u7f51\u7ad9|\u7528\u6237|\u8bbf\u95ee\u901f\u5ea6|\u76d1\u6d4b|\u5206\u6790|\u9879\u76ee|\u5206\u4eab|\u65e0\u89c5\u9605\u8bfb\n",
        "13.\n",
        "\u3010\u4e0d\u540cvlan\u95f4\u901a\u4fe1\u5982\u4f55\u5b9e\u73b0\uff1f\u3011 http://t.cn/RPLOZ49  \uff08\u5206\u4eab\u81ea@\u65e0\u89c5\u9605\u8bfb\uff09\n",
        "\u95f4\u901a\u4fe1|\u5b9e\u73b0|\u5206\u4eab|vlan|\u65e0\u89c5\u9605\u8bfb\n",
        "14.\n",
        "\u5c0f\u4f19\u4f34\u4eec\uff0c\u5feb\u6765\u56f4\u89c2\uff01\u6211\u5df2\u7ecf\u5347\u7ea7\u4e3aV6\u65b0\u7248\u5fae\u535a\uff0c\u7b80\u6d01\u7684\u754c\u9762\u5e26\u6765\u66f4\u6d41\u7545\u7684\u4f53\u9a8c\u3002\u51c6\u5907\u597d\u4e86\u5417\uff1f\u548c\u6211\u4eec\u4e00\u8d77\u53d1\u73b0\u65b0\u7684\u4e16\u754c\u5427\uff01\u5347\u7ea7\u731b\u6233:http://t.cn/R7vgnNI http://t.cn/R7PW0Ng\n",
        "\u5c0f\u4f19\u4f34|\u56f4\u89c2|\u5df2\u7ecf|\u5347\u7ea7|\u65b0\u7248|\u5fae\u535a|\u7b80\u6d01|\u754c\u9762|\u5e26\u6765|\u6d41\u7545|\u4f53\u9a8c|\u51c6\u5907|\u597d\u4e86\u5417|\u4e00\u8d77|\u53d1\u73b0|\u65b0|\u4e16\u754c|\u5347\u7ea7|\u731b|\u6233\n",
        "15.\n",
        "\u6211\u521a\u6362\u4e86\u201c\u60c5\u8ff7\u5b9d\u4e3d\u6765\u201d\u5957\u88c5\uff0c\u597d\u6f02\u4eae\uff0c\u4f60\u4eec\u90fd\u5feb\u6765\u8bd5\u8bd5\uff01 http://weibo.com/home?skinId=skin053\n",
        "\u521a\u6362|\u60c5\u8ff7|\u5b9d\u4e3d\u6765|\u5957\u88c5|\u597d|\u6f02\u4eae|\u8bd5\u8bd5\n",
        "16.\n",
        "5k \u7684iMac\u597d\u50cf\u5f88\u4e0d\u9519\n",
        "\u597d\u50cf|\u4e0d\u9519|imac\n",
        "17.\n",
        "\u4eca\u5929\u9047\u5230\u4e86\u4e24\u4e2a\u5947\u8469\n",
        "\u4eca\u5929|\u9047\u5230|\u4e24\u4e2a|\u5947\u8469\n",
        "18.\n",
        "\u6ca1\u4e8b\uff0c\u53ea\u662f\u6280\u672f\u8c03\u6574\n",
        "\u6ca1\u4e8b|\u6280\u672f|\u8c03\u6574\n",
        "19.\n",
        "\u81ea\u5df1\u628a\u8138\u90fd\u6293\u4f24\u4e86\uff0c\u6240\u4ee5\u5e26\u4e0a\u4e86\u624b\u5957\u2026 http://t.cn/Rv3EAY4\n",
        "\u8138|\u6293\u4f24|\u5e26\u4e0a|\u624b\u5957\n",
        "20.\n",
        "\u5f52\u4e61 http://t.cn/Rv1ifkh\n",
        "\u5f52\u4e61\n",
        "21.\n",
        "\u89c9\u89c9\u7684\u5ea7\u9a7e http://t.cn/RvrX4JV\n",
        "\u89c9\u89c9|\u5ea7|\u9a7e\n",
        "22.\n",
        "\u89c9\u89c9\u6ee1\u6708\u7eaa\u5ff5 http://t.cn/RPAgpC8\n",
        "\u89c9\u89c9|\u6ee1\u6708|\u7eaa\u5ff5\n",
        "23.\n",
        "#vscocam http://t.cn/RP5Bl65\n",
        "vscocam\n",
        "24.\n",
        "\u5f00\u59cb\u4f7f\u7528#\u4eb2\u5b9d\u5b9d#\u8bb0\u5f55\u5b9d\u5b9d\u6210\u957f\u8fc7\u7a0b\u4e86\u3002\u901a\u8fc7\u89c6\u9891\u3001\u7167\u7247\u3001\u5f55\u97f3\u548c\u6587\u5b57\u8bb0\u5f55\u5b9d\u5b9d\u7684\u7cbe\u5f69\u77ac\u95f4\u5e76\u6c38\u4e45\u4fdd\u5b58\uff0c\u4e0e\u4eb2\u53cb\u79c1\u5bc6\u5206\u4eab\u3002\u4e00\u6b3e\u4e13\u4e3a\u4eb2\u548c\u5b9d\u5b9d\u6253\u9020\u7684\u5e94\u7528\u54e6\uff0c\u5feb\u6765\u8bd5\u8bd5\u5427>>> http://t.cn/zj45Die\n",
        "\u4f7f\u7528|\u8bb0\u5f55|\u5b9d\u5b9d|\u6210\u957f|\u8fc7\u7a0b|\u89c6\u9891|\u7167\u7247|\u5f55\u97f3|\u6587\u5b57|\u8bb0\u5f55|\u5b9d\u5b9d|\u7cbe\u5f69|\u77ac\u95f4|\u6c38\u4e45|\u4fdd\u5b58|\u4eb2\u53cb|\u79c1\u5bc6|\u5206\u4eab|\u4e00\u6b3e|\u4e13\u4e3a|\u4eb2|\u5b9d\u5b9d|\u6253\u9020|\u5e94\u7528|\u8bd5\u8bd5|\u4eb2\u5b9d\u5b9d\n",
        "25.\n",
        "\u6e05\u98ce\u5e26\u6765\u4e86\u732b\u996d\u548c\u76f8\u58f0\u5c4a\u6cf0\u6597\u2026\u7684\u7167\u7247\u2026 http://t.cn/RP3hroF\n",
        "\u6e05\u98ce|\u5e26\u6765|\u732b|\u996d|\u76f8\u58f0|\u5c4a|\u6cf0\u6597|\u7167\u7247\n",
        "26.\n",
        "#vscocam brothers http://t.cn/RP15FGS\n",
        "vscocam|brothers\n",
        "27.\n",
        "#vscocam \u597d\u57fa\u53cb\uff0c\u4ece\u5c0f\u505a\u8d77\u2026 http://t.cn/RP1ooou\n",
        "\u597d|\u57fa\u53cb|\u505a\u8d77|vscocam\n",
        "28.\n",
        "#vscocam the most beautiful season in Beijing is coming http://t.cn/RPdvcmT\n",
        "vscocam|beautiful|season|beijing|coming\n",
        "29.\n",
        "#vscocam #flower http://t.cn/RhvWlyf\n",
        "flower|vscocam \n",
        "30.\n",
        "#vscocam corner http://t.cn/RhZPIur\n",
        "vscocam|corner\n",
        "31.\n",
        "#hyperlapse \u4e91\u5377\u4e91\u8212 http://t.cn/RhL73ob\n",
        "\u4e91\u5377\u4e91\u8212|hyperlapse\n",
        "32.\n",
        "orange windmill http://t.cn/Rh4BsIx\n",
        "orange|windmill\n",
        "33.\n",
        "#vscocam rumble fish http://t.cn/RhbSfAo\n",
        "vscocam|rumble|fish\n",
        "34.\n",
        "#vscocam http://t.cn/RhirVNt\n",
        "vscocam\n",
        "35.\n",
        "#vscocam http://t.cn/RhirMVF\n",
        "vscocam\n",
        "36.\n",
        "#vscocam loop http://t.cn/RhaF8kV\n",
        "vscocam|loop\n",
        "37.\n",
        "#vscocam http://t.cn/RhjwZz6\n",
        "vscocam\n",
        "38.\n",
        "#vscocam perfect biger than biger http://t.cn/RhRQkNm\n",
        "vscocam|perfect|biger|biger\n",
        "39.\n",
        "#vscocam Hell Peking http://t.cn/RhFmr6O\n",
        "vscocam|hell|peking"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "40.\n",
        "#vscocam \u59e5\u59e5\u7ed9\u505a\u7684\u624b\u5de5\u5e3d\u5b50 http://t.cn/R7zwvsq\n",
        "\u59e5\u59e5|\u505a|\u624b\u5de5|\u5e3d\u5b50|vscocam\n",
        "41.\n",
        "\u5c0f\u4f19\u4f34\u4eec\uff0c\u5feb\u6765\u56f4\u89c2\uff01\u6211\u5df2\u7ecf\u5347\u7ea7\u4e3aV6\u65b0\u7248\u5fae\u535a\uff0c\u7b80\u6d01\u7684\u754c\u9762\u5e26\u6765\u66f4\u6d41\u7545\u7684\u4f53\u9a8c\u3002\u51c6\u5907\u597d\u4e86\u5417\uff1f\u548c\u6211\u4eec\u4e00\u8d77\u53d1\u73b0\u65b0\u7684\u4e16\u754c\u5427\uff01\u5347\u7ea7\u731b\u6233:http://t.cn/R7vgnNI http://t.cn/R7PWS7F\n",
        "\u5c0f\u4f19\u4f34|\u56f4\u89c2|\u5df2\u7ecf|\u5347\u7ea7|\u65b0\u7248|\u5fae\u535a|\u7b80\u6d01|\u754c\u9762|\u5e26\u6765|\u6d41\u7545|\u4f53\u9a8c|\u51c6\u5907|\u597d\u4e86\u5417|\u4e00\u8d77|\u53d1\u73b0|\u65b0|\u4e16\u754c|\u5347\u7ea7|\u731b|\u6233\n",
        "42.\n",
        "#vscocam  http://t.cn/R7M9Tiu\n",
        "vscocam\n",
        "43.\n",
        "#vscocam http://t.cn/R76CfL2\n",
        "vscocam\n",
        "44.\n",
        "#vscocam \u5fc3\u597d\u7d2f\uff0c\u6765\u610f\u5927\u5229\u5582\u9e3d\u5b50\u4e5f\u4e0d\u8d77\u4f5c\u7528\u2026 http://t.cn/R7QxVE5\n",
        "\u5fc3\u597d|\u7d2f|\u610f\u5927\u5229|\u9e3d\u5b50|\u4e0d\u8d77\u4f5c\u7528|vscocam\n",
        "45.\n",
        "#vscocam http://t.cn/R73GddO\n",
        "vscocam\n",
        "46.\n",
        "\u6211\u5728 @\u77e5\u4e4e \u56de\u7b54\u4e86\u3010\u4e3a\u4ec0\u4e48\u90e8\u5206\u5f00\u53d1\u5de5\u7a0b\u5e08\u4e0d\u559c\u6b22\u8c03\u8282\u754c\u9762\u7684 UI \u7ec6\u8282\uff1f\u3011\uff1a\u5f88\u591a\u4eba\u7684\u52aa\u529b\u7a0b\u5ea6\u6839\u672c\u6ca1\u5230\u62fc\u5929\u8d4b\u7684\u5730\u6b65\uff0c\u540c\u6837\u5f88\u591a\u4ea7\u54c1\u4e5f\u6839\u672c\u6ca1\u5230\u62fc\u8bbe\u8ba1\u7684\u5730\u6b65\u3002 http://t.cn/R7knBE5\n",
        "\u56de\u7b54|\u90e8\u5206|\u5f00\u53d1|\u5de5\u7a0b\u5e08|\u559c\u6b22|\u8c03\u8282|\u754c\u9762|\u7ec6\u8282|\u4eba|\u52aa\u529b|\u7a0b\u5ea6|\u6839\u672c|\u6ca1\u5230|\u62fc|\u5929\u8d4b|\u5730\u6b65|\u540c\u6837|\u4ea7\u54c1|\u6839\u672c|\u6ca1\u5230|\u62fc|\u8bbe\u8ba1|\u5730\u6b65|ui|\u77e5\u4e4e\n",
        "47.\n",
        "[Mind Fire] \u76ee\u7684\u3001\u7ec6\u8282\u548c\u5927\u5c40\u89c2 http://t.cn/Rzz3dd2\n",
        "\u76ee\u7684|\u7ec6\u8282|\u5927\u5c40\u89c2\n",
        "48.\n",
        "[Mind Fire] \u76ee\u7684\u3001\u7ec6\u8282\u548c\u5927\u5c40\u89c2 http://t.cn/Rzz3dd2\n",
        "\u76ee\u7684|\u7ec6\u8282|\u5927\u5c40\u89c2\n",
        "49.\n",
        "\u6211\u542c\u8fc7\u8fd9\u5f20\u4e13\u8f91\u300a1701\u300b -\u674e\u5fd7 \u2605\u2605\u2605\uff1a\u4e9b\u8bb8\u5931\u843d\uff0c\u914d\u5668\u548c\u7f16\u66f2\u5982\u6b64\u4e30\u5bcc\uff0c\u5374\u6de1\u4e86\u60c5\u611f\u2026 http://t.cn/R7e82k5\n",
        "\u542c|\u8fd9\u5f20|\u4e13\u8f91|\u674e\u5fd7|\u4e9b\u8bb8|\u5931\u843d|\u914d\u5668|\u7f16\u66f2|\u4e30\u5bcc|\u5374|\u6de1|\u60c5\u611f\n",
        "50.\n",
        "#VSCOcam http://t.cn/RzABCfL\n",
        "vscocam\n",
        "51.\n",
        "\u56e0\u4e3a\u8fd9\u4e9b\u6b4c\uff0c\u7279\u522b\u60f3\u53bb\u8fd9\u4e9b\u5730\u65b9\u8d70\u8d70\u2026  \u5206\u4eab\u7cd6\u4f34\u897f\u7ea2\u67ff\u7684\u6b4c\u5355\u300a\u5730\u70b9\u300bhttp://t.cn/Rzf09lQ\uff08\u6765\u81ea@\u7f51\u6613\u4e91\u97f3\u4e50\uff09\n",
        "\u6b4c|\u7279\u522b|\u60f3|\u5730\u65b9|\u8d70\u8d70|\u5206\u4eab|\u7cd6\u4f34|\u897f\u7ea2\u67ff|\u6b4c\u5355|\u5730\u70b9|\u6765\u81ea|\u7f51\u6613\u4e91\u97f3\u4e50\n",
        "52.\n",
        "\u7528\u6765\u63d0\u795e\u9192\u8111\u2026 \u5206\u4eab\u7cd6\u4f34\u897f\u7ea2\u67ff\u7684\u6b4c\u5355\u300aPunch\u300bhttp://t.cn/RzMhqct\uff08\u6765\u81ea@\u7f51\u6613\u4e91\u97f3\u4e50\uff09\n",
        "\u7528\u6765|\u63d0\u795e\u9192\u8111|\u5206\u4eab|\u7cd6\u4f34|\u897f\u7ea2\u67ff|\u6b4c\u5355|\u6765\u81ea|punch|\u7f51\u6613\u4e91\u97f3\u4e50\n",
        "53.\n",
        "#VSCOcam http://t.cn/RzMkv8J\n",
        "vscocam\n",
        "54.\n",
        "\u8fdc\u65b9\u7684\u670b\u53cb\uff0c\u6b22\u8fce\u4f60\u5230\u6cf8\u6cbd\u6e56\u6765\u2026 \u5206\u4eab\u5de6\u5c0f\u7956\u5492/\u6731\u5a67\u7684\u5355\u66f2\u300a\u6cf8\u6cbd\u6e56\u60c5\u6b4c\u300bhttp://t.cn/RzJ8NdD\uff08\u6765\u81ea@\u7f51\u6613\u4e91\u97f3\u4e50\uff09\n",
        "\u8fdc\u65b9|\u670b\u53cb|\u6b22\u8fce|\u6cf8\u6cbd\u6e56|\u5206\u4eab|\u5de6\u5c0f\u7956\u5492|\u6731\u5a67|\u5355\u66f2|\u6cf8\u6cbd\u6e56|\u60c5\u6b4c|\u6765\u81ea|\u7f51\u6613\u4e91\u97f3\u4e50\n",
        "55.\n",
        "\u5ff5\u5929\u5ff5\u5730\u5ff5\u77e5\u5df1\u2026 \u5206\u4eab\u4e8c\u624b\u73ab\u7470\u7684\u5355\u66f2\u300a\u4ed9\u513f\u300bhttp://t.cn/RzS7IpA\uff08\u6765\u81ea@\u7f51\u6613\u4e91\u97f3\u4e50\uff09\n",
        "\u5ff5\u5929\u5ff5|\u5730\u5ff5|\u77e5\u5df1|\u5206\u4eab|\u4e8c\u624b|\u73ab\u7470|\u5355\u66f2|\u4ed9\u513f|\u6765\u81ea|\u7f51\u6613\u4e91\u97f3\u4e50\n",
        "56.\n",
        "#VSCOcam #loop http://t.cn/RzSxp3O\n",
        "loop|VSCOcam \n",
        "57.\n",
        "#VSCOcam Think different  http://t.cn/RzKyT5G\n",
        "vscocam|think|different\n",
        "58.\n",
        "#VSCOcam #HHKB http://t.cn/Rz9536i\n",
        "hhkb|VSCOcam \n",
        "59.\n",
        "#VSCOcam #fullmoon http://t.cn/RzNxOha\n",
        "fullmoon|VSCOcam \n",
        "60.\n",
        " \u5206\u4eab\u5f20\u60ac\u7684\u5355\u66f2\u300a\u73ab\u7470\u8272\u7684\u4f60\u300bhttp://t.cn/Rz0yPWF\uff08\u6765\u81ea@\u7f51\u6613\u4e91\u97f3\u4e50\uff09\n",
        "\u5206\u4eab|\u5f20\u60ac|\u5355\u66f2|\u73ab\u7470\u8272|\u6765\u81ea|\u7f51\u6613\u4e91\u97f3\u4e50\n",
        "61.\n",
        " \u5206\u4eab\u5f6d\u5766\u7684\u5355\u66f2\u300a\u706f\u5854\u300bhttp://t.cn/RzOeYbr\uff08\u6765\u81ea@\u7f51\u6613\u4e91\u97f3\u4e50\uff09\n",
        "\u5206\u4eab|\u5f6d\u5766|\u5355\u66f2|\u706f\u5854|\u6765\u81ea|\u7f51\u6613\u4e91\u97f3\u4e50\n",
        "62.\n",
        "\u300c\u4e3a\u4e86\u8fd9\u6b21\u76f8\u805a\uff0c\u6211\u8fde\u89c1\u9762\u65f6\u7684\u547c\u5438\u90fd\u66fe\u53cd\u590d\u7ec3\u4e60\u300d\u679c\u7136\u8fd8\u662f\u5185\u5fc3\u4e30\u5bcc\u7684\u4eba\u624d\u80fd\u5531\u51fa\u611f\u89c9\u2026 \u5206\u4eab\u674e\u5b97\u76db\u7684\u5355\u66f2\u300a\u6f02\u6d0b\u8fc7\u6d77\u6765\u770b\u4f60\u300bhttp://t.cn/Rzl4GHo\uff08\u6765\u81ea@\u7f51\u6613\u4e91\u97f3\u4e50\uff09\n",
        "\u8fd9\u6b21|\u76f8\u805a|\u89c1\u9762|\u65f6|\u547c\u5438|\u66fe|\u53cd\u590d|\u7ec3\u4e60|\u5185\u5fc3|\u4e30\u5bcc|\u4eba\u624d|\u80fd\u5531\u51fa|\u611f\u89c9|\u5206\u4eab|\u674e\u5b97\u76db|\u5355\u66f2|\u6f02\u6d0b\u8fc7\u6d77|\u6765\u81ea|\u7f51\u6613\u4e91\u97f3\u4e50"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "63.\n",
        " \u5206\u4eab\u9003\u8dd1\u8ba1\u5212\u7684\u5355\u66f2\u300aIs This Love\u300bhttp://t.cn/Rz3awYh\uff08\u6765\u81ea@\u7f51\u6613\u4e91\u97f3\u4e50\uff09\n",
        "\u5206\u4eab|\u9003\u8dd1|\u8ba1\u5212|\u5355\u66f2|\u6765\u81ea|love|\u7f51\u6613\u4e91\u97f3\u4e50\n",
        "64.\n",
        "#VSCOcam http://t.cn/Rz1pMnH\n",
        "vscocam\n",
        "65.\n",
        "#VSCOcam http://t.cn/RzF17xI\n",
        "vscocam\n",
        "66.\n",
        "#VSCOcam \u4e2d\u592e\u00b7\u5730\u65b9 http://t.cn/RZvjCex\n",
        "\u4e2d\u592e|\u5730\u65b9|vscocam\n",
        "67.\n",
        "#VSCOcam eagle kite http://t.cn/RZha1wg\n",
        "vscocam|eagle|kite\n",
        "68.\n",
        "\u5bb6\u5e38\u9178\u6c64\u9c7c http://t.cn/RZAcinw\n",
        "\u5bb6\u5e38|\u9178|\u6c64\u9c7c\n",
        "69.\n",
        "\u6211\u542c\u8fc7\u8fd9\u5f20\u4e13\u8f91\u300a\u613f\u7231\u65e0\u5fe7\u300b -\u75db\u4ef0 \u2605\u2605\u2605\uff1a\u300c\u76db\u5f00\u300d\u4e4b\u540e\uff0c\u518d\u65e0\u75db\u4ef0\u2026 http://t.cn/RPNqtKm\n",
        "\u542c|\u8fd9\u5f20|\u4e13\u8f91|\u613f\u7231|\u65e0\u5fe7|\u75db\u4ef0|\u76db\u5f00|\u4e4b\u540e|\u518d|\u65e0\u75db|\u4ef0\n",
        "70.\n",
        "\u901a\u8fc7@\u5fae\u76d8 \u4e0b\u8f7d\u4e86@CCL-2014 \u5206\u4eab\u7684\"CCL2014_keynote-\u5468\u5fd7\u534e.pdf\"\uff0c\u63a8\u8350\u7ed9\u5927\u5bb6\uff01 http://t.cn/R7ooGXV\n",
        "\u4e0b\u8f7d|\u5206\u4eab|\u5468\u5fd7\u534e|\u63a8\u8350|ccl|keynote|pdf|\u5fae\u76d8|CCL-2014\n",
        "71.\n",
        "\u611f\u6069\u8282\uff0c\u5c0f\u5feb\u5feb\u4e5f\u6765\u6492\u4f1a\u5a07\uff0166\u4e2a\u7ea2\u5305\u4efb\u4f60\u62a2\uff0c\u5c0f\u4f19\u4f34\u7684\u6253\u8f66\u7ea2\u5305\u90fd\u88ab\u6211\u627f\u5305\u4e86\uff01\u6709\u94b1\uff0c\u5c31\u8981\u6492\u5a07\uff0c\u8981\u7684\u70b9\u8fd9\u91cchttp://t.cn/RztWCEJ\n",
        "\u611f\u6069\u8282|\u5c0f|\u5feb\u5feb|\u6492\u4f1a\u5a07|\u7ea2\u5305|\u62a2|\u5c0f\u4f19\u4f34|\u6253\u8f66|\u7ea2\u5305|\u627f\u5305|\u6709\u94b1|\u5c31\u8981|\u6492\u5a07|\u70b9\n",
        "72.\n",
        "\u666e\u5929\u540c\u5e86\u5feb\u7684\u6253\u8f66\u5e02\u573a\u4efd\u989d\u53606\u6210\uff0166\u4e2a\u7ea2\u5305\u4efb\u4f60\u62a2\uff0c\u6240\u6709\u4eba\u7684\u6253\u8f66\u7ea2\u5305\u90fd\u88ab\u6211\u627f\u5305\u4e86\uff01\u6709\u94b1\uff0c\u5c31\u662f\u4efb\u6027\uff01\u8981\u7684\u70b9\u8fd9\u91cchttp://t.cn/RzilTFj\n",
        "\u666e\u5929\u540c\u5e86|\u6253\u8f66|\u5e02\u573a\u4efd\u989d|\u5360\u6210|\u7ea2\u5305|\u62a2|\u6240\u6709\u4eba|\u6253\u8f66|\u7ea2\u5305|\u627f\u5305|\u6709\u94b1|\u4efb\u6027|\u70b9\n",
        "73.\n",
        "#\u5954\u8dd1\u54272015# \u770b@\u6d59\u6c5f\u536b\u89c6\u8de8\u5e74\u6f14\u5531\u4f1a \uff0c\u9001@\u5feb\u7684\u6253\u8f66 #\u4e00\u4ebf\u8de8\u5e74\u7ea2\u5305#\uff01\u8981\u7684\u70b9\u8fd9\u91cc\uff1ahttp://t.cn/RZLFMf6\n",
        "\u9001|\u70b9|\u5954\u8dd1\u54272015|\u4e00\u4ebf\u8de8\u5e74\u7ea2\u5305|\u6d59\u6c5f\u536b\u89c6\u8de8\u5e74\u6f14\u5531\u4f1a|\u5feb\u7684\u6253\u8f66\n",
        "74.\n",
        "\u521a\u767b\u5f55#\u873b\u8713FM# // \u7ec8\u4e8e\u627e\u5230fm\u795e\u5668\u4e86\uff0c\u5185\u5bb9\u7206\u591a\uff0c\u65b0\u95fb\uff0c\u5c0f\u8bf4\uff0c\u97f3\u4e50\uff0c\u76f8\u58f0\uff0c\u8131\u53e3\u79c0\u2026\u2026\u60f3\u542c\u5565\u90fd\u6709\uff0c\u5173\u952e\u8fd8\u67093000\u591a\u5bb6\u7535\u53f024\u5c0f\u65f6\u4e0d\u95f4\u65ad\u76f4\u64ad\uff0c\u5feb\u53bb\u628a\u5b83\u6536\u4e86\u5427\u2192http://t.cn/S6fTEd\uff08\u5206\u4eab\u81ea@\u873b\u8713FM\uff09\n",
        "\u767b\u5f55|\u7ec8\u4e8e|\u627e\u5230|\u795e\u5668|\u5185\u5bb9|\u7206\u591a|\u65b0\u95fb|\u5c0f\u8bf4|\u97f3\u4e50|\u76f8\u58f0|\u8131\u53e3\u79c0|\u60f3|\u542c|\u5173\u952e|\u591a\u5bb6|\u7535\u53f0|\u5c0f\u65f6|\u4e0d\u95f4\u65ad|\u76f4\u64ad|\u6536|fm|\u873b\u8713FM\n",
        "75.\n",
        "\u5c0f\u4f19\u4f34\u4eec\uff0c\u5feb\u6765\u56f4\u89c2\uff01\u6211\u5df2\u7ecf\u5347\u7ea7\u4e3aV6\u65b0\u7248\u5fae\u535a\uff0c\u7b80\u6d01\u7684\u754c\u9762\u5e26\u6765\u66f4\u6d41\u7545\u7684\u4f53\u9a8c\u3002\u51c6\u5907\u597d\u4e86\u5417\uff1f\u548c\u6211\u4eec\u4e00\u8d77\u53d1\u73b0\u65b0\u7684\u4e16\u754c\u5427\uff01\u5347\u7ea7\u731b\u6233:http://t.cn/R7vgnNI http://t.cn/R7PWS7F\n",
        "\u5c0f\u4f19\u4f34|\u56f4\u89c2|\u5df2\u7ecf|\u5347\u7ea7|\u65b0\u7248|\u5fae\u535a|\u7b80\u6d01|\u754c\u9762|\u5e26\u6765|\u6d41\u7545|\u4f53\u9a8c|\u51c6\u5907|\u597d\u4e86\u5417|\u4e00\u8d77|\u53d1\u73b0|\u65b0|\u4e16\u754c|\u5347\u7ea7|\u731b|\u6233\n",
        "76.\n",
        "\u6ca1\u6709\u7403\u7684\u665a\u4e0a\uff0c\u5e72\u6d3b\u60f3\u4e1c\u897f\u66f4\u5229\u7d22\u4e86\uff01\n",
        "\u7403|\u665a\u4e0a|\u5e72\u6d3b|\u60f3|\u4e1c\u897f|\u5229\u7d22\n",
        "77.\n",
        "\u5173\u4e8e\u6cd5\u5f8b\u7535\u5546\uff0c\u8fd9\u4e2a\u521b\u4e1a\u673a\u4f1a\u5f88\u5bb9\u6613\u770b\u61c2\uff0c\u901a\u8fc7\u7535\u8bdd\u6216\u5728\u7ebf\u7684\u65b9\u5f0f\u964d\u4f4e\u4e3a\u4e2d\u5c0f\u4f01\u4e1a\u63d0\u4f9b\u6cd5\u5f8b\u670d\u52a1\u7684\u6210\u672c\uff0c\u5e76\u901a\u8fc7\u670d\u52a1\u6807\u51c6\u5316\u83b7\u5f97\u89c4\u6a21\u6548\u76ca\u3002\n",
        "\u6cd5\u5f8b|\u7535\u5546|\u521b\u4e1a|\u673a\u4f1a|\u5bb9\u6613|\u61c2|\u7535\u8bdd|\u5728\u7ebf|\u65b9\u5f0f|\u964d\u4f4e|\u4e2d\u5c0f\u4f01\u4e1a|\u63d0\u4f9b|\u6cd5\u5f8b|\u670d\u52a1|\u6210\u672c|\u670d\u52a1|\u6807\u51c6\u5316|\u83b7\u5f97|\u89c4\u6a21|\u6548\u76ca\n",
        "78.\n",
        "http://t.cn/RhSzcyD\n",
        "\n",
        "79.\n",
        "\u4e3b\u6d41\u6d88\u8d39\u8005\u9700\u6c42\u56fe\u8c31.\n",
        "\u4e3b\u6d41|\u6d88\u8d39\u8005|\u9700\u6c42|\u56fe\u8c31\n"
       ]
      }
     ],
     "prompt_number": 248
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print re.sub('[\u3010\u3011\u256e\u256f\u25bd\u2570\u256d]'.decode('utf8'),\"\",fw.weibo_train_data.context[3].decode('utf8'))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "[doge]\u627e\u5de5\u4f5c()\u2026\u2026\n"
       ]
      }
     ],
     "prompt_number": 165
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print re.findall(\"#(.{0,30})#\",fw.weibo_train_data.context[5])[1].decode('utf8')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\u9b54\u6d6a\u6f6e\u7206U5\u667a\u80fd\u8033\u673a\n"
       ]
      }
     ],
     "prompt_number": 186
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "'[\u25bd]'.decode('utf8')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 247,
       "text": [
        "u'[\\u25bd]'"
       ]
      }
     ],
     "prompt_number": 247
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "re.findall?"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 242
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print re.findall(\"@(.{0,30})\uff09\",fw.weibo_train_data.context[9])[0]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\u65e0\u89c5\u9605\u8bfb\n"
       ]
      }
     ],
     "prompt_number": 235
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print at[0].decode(\"utf8\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "ename": "AttributeError",
       "evalue": "'tuple' object has no attribute 'decode'",
       "output_type": "pyerr",
       "traceback": [
        "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
        "\u001b[0;32m<ipython-input-211-2e90dda577da>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mprint\u001b[0m \u001b[0mat\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mdecode\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"utf8\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
        "\u001b[0;31mAttributeError\u001b[0m: 'tuple' object has no attribute 'decode'"
       ]
      }
     ],
     "prompt_number": 211
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "a=fw.pd.Series()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 261
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "a.append([1,2,3])"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "ename": "TypeError",
       "evalue": "cannot concatenate a non-NDFrame object",
       "output_type": "pyerr",
       "traceback": [
        "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
        "\u001b[0;32m<ipython-input-262-bb81017f99b0>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0ma\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
        "\u001b[0;32m/Users/Pro/canopy/lib/python2.7/site-packages/pandas/core/series.pyc\u001b[0m in \u001b[0;36mappend\u001b[0;34m(self, to_append, verify_integrity)\u001b[0m\n\u001b[1;32m   1407\u001b[0m             \u001b[0mto_concat\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mto_append\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1408\u001b[0m         return concat(to_concat, ignore_index=False,\n\u001b[0;32m-> 1409\u001b[0;31m                       verify_integrity=verify_integrity)\n\u001b[0m\u001b[1;32m   1410\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1411\u001b[0m     \u001b[0;32mdef\u001b[0m \u001b[0m_binop\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mother\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlevel\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mNone\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfill_value\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mNone\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
        "\u001b[0;32m/Users/Pro/canopy/lib/python2.7/site-packages/pandas/tools/merge.pyc\u001b[0m in \u001b[0;36mconcat\u001b[0;34m(objs, axis, join, join_axes, ignore_index, keys, levels, names, verify_integrity)\u001b[0m\n\u001b[1;32m    715\u001b[0m                        \u001b[0mignore_index\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mignore_index\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mjoin\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mjoin\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    716\u001b[0m                        \u001b[0mkeys\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mkeys\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlevels\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mlevels\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mnames\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mnames\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 717\u001b[0;31m                        verify_integrity=verify_integrity)\n\u001b[0m\u001b[1;32m    718\u001b[0m     \u001b[0;32mreturn\u001b[0m \u001b[0mop\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_result\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    719\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n",
        "\u001b[0;32m/Users/Pro/canopy/lib/python2.7/site-packages/pandas/tools/merge.pyc\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, objs, axis, join, join_axes, keys, levels, names, ignore_index, verify_integrity)\u001b[0m\n\u001b[1;32m    766\u001b[0m         \u001b[0;32mfor\u001b[0m \u001b[0mobj\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mobjs\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    767\u001b[0m             \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mobj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mNDFrame\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 768\u001b[0;31m                 \u001b[0;32mraise\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"cannot concatenate a non-NDFrame object\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    769\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    770\u001b[0m             \u001b[0;31m# consolidate\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
        "\u001b[0;31mTypeError\u001b[0m: cannot concatenate a non-NDFrame object"
       ]
      }
     ],
     "prompt_number": 262
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "'\u25bd'.decode('utf8')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 69,
       "text": [
        "u'\\u25bd'"
       ]
      }
     ],
     "prompt_number": 69
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "'.'.decode('utf8')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 70,
       "text": [
        "u'.'"
       ]
      }
     ],
     "prompt_number": 70
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "'\u2026'.decode('utf8')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 72,
       "text": [
        "u'\\u2026'"
       ]
      }
     ],
     "prompt_number": 72
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "a[0]=[1,2,3]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "ename": "IndexError",
       "evalue": "index 0 is out of bounds for axis 0 with size 0",
       "output_type": "pyerr",
       "traceback": [
        "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mIndexError\u001b[0m                                Traceback (most recent call last)",
        "\u001b[0;32m<ipython-input-258-c47480f4cd6d>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0ma\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;36m1\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;36m3\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
        "\u001b[0;32m/Users/Pro/canopy/lib/python2.7/site-packages/pandas/core/series.pyc\u001b[0m in \u001b[0;36m__setitem__\u001b[0;34m(self, key, value)\u001b[0m\n\u001b[1;32m    597\u001b[0m                     and not self.index.inferred_type == 'integer'):\n\u001b[1;32m    598\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 599\u001b[0;31m                 \u001b[0mvalues\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mvalue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    600\u001b[0m                 \u001b[0;32mreturn\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    601\u001b[0m             \u001b[0;32melif\u001b[0m \u001b[0mkey\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0mEllipsis\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
        "\u001b[0;31mIndexError\u001b[0m: index 0 is out of bounds for axis 0 with size 0"
       ]
      }
     ],
     "prompt_number": 258
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import weiboPredict"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 7
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "reload(weiboPredict.framework)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 263,
       "text": [
        "<module 'weiboPredict.framework' from '/Users/Pro/Ongoing/weibo/weiboPredict/framework.py'>"
       ]
      }
     ],
     "prompt_number": 263
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from weiboPredict import framework as fw"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "'\uff09'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 250,
       "text": [
        "'\\xef\\xbc\\x89'"
       ]
      }
     ],
     "prompt_number": 250
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.loadData()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 264
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "tmp = fw.cleanText(fw.weibo_train_data.context[:5])"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "Building prefix dict from /Users/Pro/canopy/lib/python2.7/site-packages/jieba/dict.txt ...\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "DEBUG:jieba:Building prefix dict from /Users/Pro/canopy/lib/python2.7/site-packages/jieba/dict.txt ...\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "Loading model from cache /var/folders/rv/scpt0ywn277bqhjg160ms0d40000gp/T/jieba.cache\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "DEBUG:jieba:Loading model from cache /var/folders/rv/scpt0ywn277bqhjg160ms0d40000gp/T/jieba.cache\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "Loading model cost 0.556 seconds.\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "DEBUG:jieba:Loading model cost 0.556 seconds.\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "Prefix dict has been built succesfully.\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "DEBUG:jieba:Prefix dict has been built succesfully.\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print '|'.join(tmp[1])"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\u7231|\u5c0f\u7c73|\u624b\u673a|\u5c0f\u7c73|\u624b\u673a|\u5c4f\u5e55|\u592a\u7ed9\u529b|\u82f1\u5bf8|\u9ad8|\u8272\u5f69|\u9971\u548c\u5ea6|\u590f\u666e|JDI|\u5c4f\u5e55|x|\u5168\u9ad8\u6e05|\u5206\u8fa8\u7387|\u73a9\u6e38\u620f|\u9ad8\u6e05|\u89c6\u9891|\u723d\u7206|\u6708|\u65e5|\u4e2d\u5348|\u70b9|\u5f00\u653e|\u8d2d\u4e70|\u4ec5\u552e\u5143|\u5e0c\u671b|\u4e70|\u53f0|\u5c0f\u7c73|\u624b\u673a|\u5356|\u4ed9\u5251|\u9152\u5251\u4ed9|\u6d77|\u5148\u751f|V|\u5206\u4eab|\u514d\u8d39|\u9884\u7ea6|\u5730\u5740\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "t = fw.weibo_train_data"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 296
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print \"..\u54c8\u54c8\uff5d\uff1a:\".replace(string.punctuation,\"\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "..\u54c8\u54c8\uff5d\uff1a:\n"
       ]
      }
     ],
     "prompt_number": 97
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "t.head()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>uid</th>\n",
        "      <th>mid</th>\n",
        "      <th>time</th>\n",
        "      <th>forward_count</th>\n",
        "      <th>comment_count</th>\n",
        "      <th>like_count</th>\n",
        "      <th>context</th>\n",
        "      <th>a</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> 5fefc2488f99aba5782baa43096b76dc</td>\n",
        "      <td> 2014-11-04</td>\n",
        "      <td> 0</td>\n",
        "      <td> 7</td>\n",
        "      <td> 2</td>\n",
        "      <td> [\u5410]@\u4eac\u4e1c \u7684\u7528\u6237\u4f53\u9a8c\u592a\u5dee\u4e86....\u7b2c\u4e00\u6b21\u5728\u4eac\u4e1c\u8d2d\u7269\uff0c\u4e70\u4e86\u51e0\u767e\u7684\u4e66....\u771f\u662f\u7ecf\u5386\u4e86\u7f51\u8d2d\u7684...</td>\n",
        "      <td> [\u5410, \u4eac\u4e1c, \u7528\u6237, \u4f53\u9a8c, \u592a\u5dee, ...., \u7b2c\u4e00\u6b21, \u4eac\u4e1c, \u8d2d\u7269, \u4e70, \u51e0\u767e, ...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> 397d9abe2ebf9ba986fe5ab5a6139e11</td>\n",
        "      <td> 2014-11-04</td>\n",
        "      <td> 0</td>\n",
        "      <td> 3</td>\n",
        "      <td> 0</td>\n",
        "      <td> #\u6211\u7231\u5c0f\u7c73\u624b\u673a#\u56e0\u4e3a\u5c0f\u7c73\u624b\u673a4\u7684\u5c4f\u5e55\u592a\u7ed9\u529b\u4e86\uff0c5\u82f1\u5bf8\u7684\u9ad8\u8272\u5f69\u9971\u548c\u5ea6\u590f\u666e / JDI\u5c4f\u5e55\uff0c19...</td>\n",
        "      <td> [\u7231, \u5c0f\u7c73, \u624b\u673a, \u5c0f\u7c73, \u624b\u673a, \u5c4f\u5e55, \u592a\u7ed9\u529b, \u82f1\u5bf8, \u9ad8, \u8272\u5f69, \u9971\u548c\u5ea6, \u590f...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> a2ae3959e9aa21a47993506e2609a4ec</td>\n",
        "      <td> 2014-11-08</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>              [doge][\u55b5\u55b5]\u5929\u732b\u771f\u662f\u725b....\u5356\u5b9e\u9a8c\u8017\u6750\u7684\u90fd\u8dd1\u5929\u732b\u53bb\u5f00\u5e97\u4e86...</td>\n",
        "      <td> [doge, \u55b5, \u55b5, \u5929\u732b, \u771f\u662f, \u725b, ...., \u5356, \u5b9e\u9a8c, \u8017\u6750, \u8dd1, \u5929\u732b...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>3</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> fcc63a086522040a271ba6d1fb604734</td>\n",
        "      <td> 2014-11-09</td>\n",
        "      <td> 0</td>\n",
        "      <td> 6</td>\n",
        "      <td> 0</td>\n",
        "      <td>                                [doge]\u627e\u5de5\u4f5c\u256e(\u256f\u25bd\u2570)\u256d\u2026\u2026</td>\n",
        "      <td>                      [doge, \u627e, \u5de5\u4f5c, \u256e, \u256f, \u25bd, \u2570, \u256d]</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>4</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> 6ab0f93ab59cbdaf25f4a023642971a6</td>\n",
        "      <td> 2014-11-11</td>\n",
        "      <td> 0</td>\n",
        "      <td> 5</td>\n",
        "      <td> 1</td>\n",
        "      <td>                                  [doge]\u6210\u529f\u62a2\u4e86\u53f0\u7c734\u7535\u4fe1~</td>\n",
        "      <td>                             [doge, \u6210\u529f, \u62a2, \u53f0\u7c73, \u7535\u4fe1]</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 298,
       "text": [
        "                                uid                               mid  \\\n",
        "0  07fc721342df1a4c1992560b582992f8  5fefc2488f99aba5782baa43096b76dc   \n",
        "1  07fc721342df1a4c1992560b582992f8  397d9abe2ebf9ba986fe5ab5a6139e11   \n",
        "2  07fc721342df1a4c1992560b582992f8  a2ae3959e9aa21a47993506e2609a4ec   \n",
        "3  07fc721342df1a4c1992560b582992f8  fcc63a086522040a271ba6d1fb604734   \n",
        "4  07fc721342df1a4c1992560b582992f8  6ab0f93ab59cbdaf25f4a023642971a6   \n",
        "\n",
        "         time  forward_count  comment_count  like_count  \\\n",
        "0  2014-11-04              0              7           2   \n",
        "1  2014-11-04              0              3           0   \n",
        "2  2014-11-08              0              0           0   \n",
        "3  2014-11-09              0              6           0   \n",
        "4  2014-11-11              0              5           1   \n",
        "\n",
        "                                             context  \\\n",
        "0  [\u5410]@\u4eac\u4e1c \u7684\u7528\u6237\u4f53\u9a8c\u592a\u5dee\u4e86....\u7b2c\u4e00\u6b21\u5728\u4eac\u4e1c\u8d2d\u7269\uff0c\u4e70\u4e86\u51e0\u767e\u7684\u4e66....\u771f\u662f\u7ecf\u5386\u4e86\u7f51\u8d2d\u7684...   \n",
        "1  #\u6211\u7231\u5c0f\u7c73\u624b\u673a#\u56e0\u4e3a\u5c0f\u7c73\u624b\u673a4\u7684\u5c4f\u5e55\u592a\u7ed9\u529b\u4e86\uff0c5\u82f1\u5bf8\u7684\u9ad8\u8272\u5f69\u9971\u548c\u5ea6\u590f\u666e / JDI\u5c4f\u5e55\uff0c19...   \n",
        "2               [doge][\u55b5\u55b5]\u5929\u732b\u771f\u662f\u725b....\u5356\u5b9e\u9a8c\u8017\u6750\u7684\u90fd\u8dd1\u5929\u732b\u53bb\u5f00\u5e97\u4e86...   \n",
        "3                                 [doge]\u627e\u5de5\u4f5c\u256e(\u256f\u25bd\u2570)\u256d\u2026\u2026   \n",
        "4                                   [doge]\u6210\u529f\u62a2\u4e86\u53f0\u7c734\u7535\u4fe1~   \n",
        "\n",
        "                                                   a  \n",
        "0  [\u5410, \u4eac\u4e1c, \u7528\u6237, \u4f53\u9a8c, \u592a\u5dee, ...., \u7b2c\u4e00\u6b21, \u4eac\u4e1c, \u8d2d\u7269, \u4e70, \u51e0\u767e, ...  \n",
        "1  [\u7231, \u5c0f\u7c73, \u624b\u673a, \u5c0f\u7c73, \u624b\u673a, \u5c4f\u5e55, \u592a\u7ed9\u529b, \u82f1\u5bf8, \u9ad8, \u8272\u5f69, \u9971\u548c\u5ea6, \u590f...  \n",
        "2  [doge, \u55b5, \u55b5, \u5929\u732b, \u771f\u662f, \u725b, ...., \u5356, \u5b9e\u9a8c, \u8017\u6750, \u8dd1, \u5929\u732b...  \n",
        "3                       [doge, \u627e, \u5de5\u4f5c, \u256e, \u256f, \u25bd, \u2570, \u256d]  \n",
        "4                              [doge, \u6210\u529f, \u62a2, \u53f0\u7c73, \u7535\u4fe1]  "
       ]
      }
     ],
     "prompt_number": 298
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "tmp.to_csv('test.csv')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 299
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "clean_context = fw.cleanText(fw.weibo_train_data.context)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "Building prefix dict from /Users/Pro/canopy/lib/python2.7/site-packages/jieba/dict.txt ...\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "DEBUG:jieba:Building prefix dict from /Users/Pro/canopy/lib/python2.7/site-packages/jieba/dict.txt ...\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "Dumping model to file cache /var/folders/rv/scpt0ywn277bqhjg160ms0d40000gp/T/jieba.cache\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "DEBUG:jieba:Dumping model to file cache /var/folders/rv/scpt0ywn277bqhjg160ms0d40000gp/T/jieba.cache\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "Loading model cost 2.045 seconds.\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "DEBUG:jieba:Loading model cost 2.045 seconds.\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "Prefix dict has been built succesfully.\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stderr",
       "text": [
        "DEBUG:jieba:Prefix dict has been built succesfully.\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "10000/1229618\n",
        "20000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "30000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "40000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "50000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "60000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "70000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "80000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "90000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "100000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "110000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "120000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "130000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "140000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "150000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "160000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "170000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "180000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "190000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "200000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "210000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "220000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "230000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "240000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "250000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "260000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "270000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "280000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "290000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "300000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "310000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "320000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "330000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "340000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "350000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "360000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "370000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "380000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "390000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "400000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "410000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "420000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "430000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "440000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "450000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "460000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "470000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "480000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "490000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "500000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "510000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "520000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "530000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "540000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "550000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "560000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "570000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "580000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "590000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "600000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "610000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "620000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "630000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "640000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "650000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "660000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "670000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "680000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "690000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "700000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "710000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "720000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "730000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "740000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "750000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "760000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "770000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "780000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "790000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "800000/1229618"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n"
       ]
      },
      {
       "ename": "TypeError",
       "evalue": "expected string or buffer",
       "output_type": "pyerr",
       "traceback": [
        "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
        "\u001b[0;32m<ipython-input-9-e2c1ee8e9e99>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mclean_context\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mfw\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcleanText\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfw\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mweibo_train_data\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcontext\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
        "\u001b[0;32m/Users/Pro/Ongoing/weibo/weiboPredict/framework.py\u001b[0m in \u001b[0;36mcleanText\u001b[0;34m(contexts)\u001b[0m\n\u001b[1;32m     72\u001b[0m         \u001b[0;32mfor\u001b[0m \u001b[0mcontext\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mcontexts\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     73\u001b[0m             \u001b[0;31m# remove links\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 74\u001b[0;31m             \u001b[0mcontext\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mre\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msub\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"http://[a-zA-z./\\d]*\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\"\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mcontext\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m     75\u001b[0m             \u001b[0;31m# remove emojo\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     76\u001b[0m             \u001b[0mcontext\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mre\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msub\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"\\[.{0,12}\\]\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\"\"\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mcontext\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
        "\u001b[0;32m/Applications/Canopy.app/appdata/canopy-1.4.1.1975.macosx-x86_64/Canopy.app/Contents/lib/python2.7/re.pyc\u001b[0m in \u001b[0;36msub\u001b[0;34m(pattern, repl, string, count, flags)\u001b[0m\n\u001b[1;32m    149\u001b[0m     \u001b[0ma\u001b[0m \u001b[0mcallable\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mit\u001b[0m\u001b[0;31m'\u001b[0m\u001b[0ms\u001b[0m \u001b[0mpassed\u001b[0m \u001b[0mthe\u001b[0m \u001b[0mmatch\u001b[0m \u001b[0mobject\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mmust\u001b[0m \u001b[0;32mreturn\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    150\u001b[0m     a replacement string to be used.\"\"\"\n\u001b[0;32m--> 151\u001b[0;31m     \u001b[0;32mreturn\u001b[0m \u001b[0m_compile\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpattern\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mflags\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msub\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mrepl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstring\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcount\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    152\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    153\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0msubn\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpattern\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mrepl\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mstring\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcount\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mflags\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
        "\u001b[0;31mTypeError\u001b[0m: expected string or buffer"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "predict_clean_text = fw.cleanText(fw.weibo_predict_data.context)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "clean_context.head()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 8,
       "text": [
        "0    [\u5410, \u4eac\u4e1c, \u7528\u6237, \u4f53\u9a8c, \u592a\u5dee, ...., \u7b2c\u4e00\u6b21, \u4eac\u4e1c, \u8d2d\u7269, \u4e70, \u51e0\u767e, ...\n",
        "1    [\u7231, \u5c0f\u7c73, \u624b\u673a, \u5c0f\u7c73, \u624b\u673a, \u5c4f\u5e55, \u592a\u7ed9\u529b, \u82f1\u5bf8, \u9ad8, \u8272\u5f69, \u9971\u548c\u5ea6, \u590f...\n",
        "2    [doge, \u55b5, \u55b5, \u5929\u732b, \u771f\u662f, \u725b, ...., \u5356, \u5b9e\u9a8c, \u8017\u6750, \u8dd1, \u5929\u732b...\n",
        "3                         [doge, \u627e, \u5de5\u4f5c, \u256e, \u256f, \u25bd, \u2570, \u256d]\n",
        "4                                [doge, \u6210\u529f, \u62a2, \u53f0\u7c73, \u7535\u4fe1]\n",
        "dtype: object"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "clean_context = clean_context.apply(lambda x:json.dumps(x))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 18
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "clean_context.to_csv('../data/train_context_clean.csv')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 19
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "predict_clean_text = predict_clean_text.apply(lambda x:json.dumps(x))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 16
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "predict_clean_text.to_csv('../data/predict_context_clean.csv')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 17
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "a=[]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 257
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "b=[1,2]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 258
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "a.append(b)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 259
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import json"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 10
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "a.append(b)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 261
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "a"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 262,
       "text": [
        "[[1, 2], [1, 2]]"
       ]
      }
     ],
     "prompt_number": 262
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "clean_context[250:270]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 270,
       "text": [
        "250                          [\u5c0f\u7c73, \u8def\u7531, \u5de5\u4f5c, \u5c0f\u7c73, \u8def\u7531\u5668, mini]\n",
        "251                      [\u5c0f\u7c73, \u8def\u7531, \u51c6\u5907, \u5de5\u4f5c, \u5c0f\u7c73, \u8def\u7531\u5668, mini]\n",
        "252      [\u8def\u7531\u5668, \u7535\u6e90, \u9700\u8981, \u505a, \u5bbd\u5927, \u5e72\u7740\u6025, \u63d2, \u76f4, \u90c1\u95f7, \u4eba\u96f7\u519b, \u5c0f\u7c73\u8def\u7531\u5668]\n",
        "253    [\u559c\u6b22, \u53d1\u597d, \u56fe, \u4eba, \u54c1\u5473, \u4e0d\u574f, \u83b7\u5f97, \u8c4c\u8c46\u835a, \u8bbe\u8ba1\u5956, \u6700\u7f8e, \u56fe\u7247, \u793e...\n",
        "254    [\u5347\u7ea7, \u4e00\u4e0b, \u78c1\u76d8\u683c\u5f0f, \u652f\u6301, \u53d1\u73b0, \u4e00\u4e2a, \u65b0, \u95ee\u9898, \u4e00\u4e2a, \u79fb\u52a8\u786c\u76d8, \u542b\u4e2a...\n",
        "255    [\u5e7f\u64ad, \u8bf4, \u79d1\u5b66\u7814\u7a76, \u5927\u91cf, \u7edf\u8ba1, \u5df2\u7ecf, \u8bc1\u660e, \u5b63\u8282, \u51fa\u751f, \u4eba, \u5177\u5907, \u6027...\n",
        "256                                     [\u684c\u4e0a, \u5357\u74dc, \u541b, \u5c0f\u73a9\u610f]\n",
        "257                                             [\u79cb, \u82b1\u8349\u96c6]\n",
        "258                              [\u9ed1\u6697, \u4e2d, \u73bb\u7483\u676f, \u6765\u81ea, \u5fae\u53ef, \u62cd]\n",
        "259                                    [\u9ed1\u6697, \u4e2d, \u73bb\u7483\u676f, \u5c0f\u73a9\u610f]\n",
        "260      [\u56fe\u9489, \u7167\u7247, \u89c6\u9891, \u76f4\u64ad, \u5c0f, \u751f\u6d3b, \u901f\u5ea6, \u4e0b\u8f7d, \u56f4\u89c2, Grinch1982]\n",
        "261           [\u56fe\u9489, \u7167\u7247, \u89c6\u9891, \u76f4\u64ad, \u5c0f, \u751f\u6d3b, \u901f\u5ea6, \u4e0b\u8f7d, \u56f4\u89c2, \u56fe\u866b\u6444\u5f71\u7f51]\n",
        "262       [\u56fe\u9489, \u7167\u7247, \u89c6\u9891, \u76f4\u64ad, \u5c0f, \u751f\u6d3b, \u901f\u5ea6, \u4e0b\u8f7d, \u56f4\u89c2, \u4e00\u90ceLithium]\n",
        "263             [\u56fe\u9489, \u7167\u7247, \u89c6\u9891, \u76f4\u64ad, \u5c0f, \u751f\u6d3b, \u901f\u5ea6, \u4e0b\u8f7d, \u56f4\u89c2, \u559c\u74dc\u7f51]\n",
        "264             [\u56fe\u9489, \u7167\u7247, \u89c6\u9891, \u76f4\u64ad, \u5c0f, \u751f\u6d3b, \u901f\u5ea6, \u4e0b\u8f7d, \u56f4\u89c2, \u82b1\u74e3\u7f51]\n",
        "265          [\u56fe\u9489, \u7167\u7247, \u89c6\u9891, \u76f4\u64ad, \u5c0f, \u751f\u6d3b, \u901f\u5ea6, \u4e0b\u8f7d, \u56f4\u89c2, \u6444\u5f71\u5e08\u6797\u6d77\u97f3]\n",
        "266        [\u56fe\u9489, \u7167\u7247, \u89c6\u9891, \u76f4\u64ad, \u5c0f, \u751f\u6d3b, \u901f\u5ea6, \u4e0b\u8f7d, \u56f4\u89c2, MetroSet]\n",
        "267          [\u56fe\u9489, \u7167\u7247, \u89c6\u9891, \u76f4\u64ad, \u5c0f, \u751f\u6d3b, \u901f\u5ea6, \u4e0b\u8f7d, \u56f4\u89c2, \u6444\u5f71\u5e08\u674e\u5c0f\u857e]\n",
        "268           [\u56fe\u9489, \u7167\u7247, \u89c6\u9891, \u76f4\u64ad, \u5c0f, \u751f\u6d3b, \u901f\u5ea6, \u4e0b\u8f7d, \u56f4\u89c2, POCO\u7f51]\n",
        "269    [\u559c\u6b22, \u53d1\u597d, \u56fe, \u4eba, \u54c1\u5473, \u4e0d\u574f, \u83b7\u5f97, \u8c4c\u8c46\u835a, \u8bbe\u8ba1\u5956, \u6700\u7f8e, \u56fe\u7247, \u793e...\n",
        "dtype: object"
       ]
      }
     ],
     "prompt_number": 270
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print fw.weibo_train_data.context[257].decode('utf8')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\u79cb #\u82b1\u8349\u96c6#  http://t.cn/R70TGvn (\u514d\u8d39\u4e0b\u8f7dhttp://t.cn/zj9vjC3 )\n"
       ]
      }
     ],
     "prompt_number": 273
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print '/'.join(clean_context[257])"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\u79cb/\u82b1\u8349\u96c6\n"
       ]
      }
     ],
     "prompt_number": 276
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print fw.weibo_train_data.context[252].decode('utf8')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\u8def\u7531\u5668\u7535\u6e90\u9700\u8981\u505a\u8fd9\u4e48\u5bbd\u5927\u5417\uff1f\u5e72\u7740\u6025\uff0c\u5dee\u4e00\u70b9\u5c31\u662f\u63d2\u4e0d\u8fdb\u53bb\uff0c\u76f4\u90c1\u95f7\u4eba@\u5c0f\u7c73\u8def\u7531\u5668 @\u96f7\u519b\n"
       ]
      }
     ],
     "prompt_number": 277
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print '/'.join(clean_context[252])"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\u8def\u7531\u5668/\u7535\u6e90/\u9700\u8981/\u505a/\u5bbd\u5927/\u5e72\u7740\u6025/\u63d2/\u76f4/\u90c1\u95f7/\u4eba\u96f7\u519b/\u5c0f\u7c73\u8def\u7531\u5668\n"
       ]
      }
     ],
     "prompt_number": 278
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "pdb"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Automatic pdb calling has been turned ON\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import re\n",
      "for i,context in enumerate(fw.weibo_train_data.context):\n",
      "    context = re.sub(\"http://[a-zA-z./\\d]*\",\"\",context)\n",
      "    print i"
     ],
     "language": "python",
     "metadata": {},
     "outputs": []
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}